<%include file="include/head.html"%>
<div class="wrapper">
  <div id="div-home" class="main-info-box">
    <%include file="include/crumbs.html"%>
    <%include file="include/edit_nav.html"%>
    <div class="div-info-body">
      <div id="div-search">
	<form action="/users/search" method="get">
	  <select required1 class="required" id="province_id">
	    <%$provinces%>
	  </select>
	  <select class="required" id="city_id">
	    <%$cities%>
	  </select>
	  <select class="required" id="town_id">
	    <%$towns%>
	  </select>
	  <input type="hidden" name="region_code" id="city_code" value="<%$region_code%>"/>

	  <input type="hidden" name="userid" value="<%$userid%>"/>
	  <input required class="required" type="search" name="realname" placeholder="输入人名" value="<%$realname%>"/>
	  <input class="ym-button" type="submit" value="搜索"/>
	</form>
      </div>
      <div>
	<%if $error%>
	<%$error%>
	<%else%>
	<% if $users|@count gt 0%>
	<table>
          <caption>查询结果</caption>
          <tr>
            <th>头像</th>
            <th>姓名</th>
            <th>出生年月</th>
            <th>地区</th>
            <th>详情</th>
            <th>操作</th>
          </tr>
	  <%foreach from=$users item=rel%>
	  <tr class="dl-in-search">
	    <td class="dt-figure"><img src="<%$rel.figureurl%>"/></td>
	    <td class="name"><%$rel.realname%></td>
	    <td class="birth"><%$rel.day_of_birth%>出生</td>
	    <td class="region"><%$rel.region_name%></td>
	    <td><a href="/users/home?userid=<%$rel.id%>">查看详情</a></td>
	    <%if $userid%>
	    <td><a href="/relation/request?userid=<%$userid%>&relid=<%$rel.id%>">添加关系</a></td>
	    <%/if%>
	  </tr>
	  <%/foreach%>
	  <tr>
	    <td colspan="6"><%$page%></td>
	  </tr>
	</table>
	<%else%>
	<span class="warnning">
	  没有找到你要查找的人！
	</span>
	<%/if%>
	<%/if%>
      </div>
    </div>
    <div class="clear"></div>
  </div>
</div>
<%include file="include/bottom.html"%>
